package com.nervenets.shopping.hibernate.domain.user.vo;

import com.nervenets.general.model.GeneralModel;
import com.nervenets.shopping.enumeration.Gender;
import com.nervenets.shopping.hibernate.domain.user.User;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.springframework.beans.BeanUtils;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class UserVo extends GeneralModel {
    @ApiModelProperty(value = "昵称")
    private String name;
    @ApiModelProperty(value = "头像")
    private String avatar;
    @ApiModelProperty(value = "性别")
    private Gender gender = Gender.female;
    @ApiModelProperty(value = "邀请人")
    private UserVo inviteUser;

    public UserVo(User user) {
        BeanUtils.copyProperties(user, this);
    }
}
